<?php
use yii\bootstrap\ActiveForm;
?>
<link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css" type="text/css">
<link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/datatables/jquery.dataTables.css" type="text/css">
<link rel="stylesheet" href="../static/css/admin.css" type="text/css">
<link rel="stylesheet" href="../static/jBox/Skins/Metro/jbox.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.css" type="text/css">
<link rel="stylesheet" href="../static/plugins/treeTable/jquery.treetable.theme.default.css" type="text/css">
<style>
    .ul_tree_display{
        display: none;
    }
    .tr_tree_display{
        display: none;
    }
    .dataTables_length{
        margin-top: 10px;
    }
    .dataTable>tbody>tr>td{
        vertical-align: middle;
        font-size: 0.8em;
        padding: 8px 18px;
    }
    .dataTable>thead>tr>th{
        vertical-align: middle;
        font-size: 0.8em;
    }
    .table>tbody>tr>td{
        vertical-align: middle;
        font-size: 0.8em;
    }
</style>
<div class="tabs-panel">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <!--<h3 class="box-title">Hover Data Table</h3>-->
                    品类名称: <input class="depart-input" name="tag_name" id="tag_name" type="text" placeholder="">
                    <button type="button" class="btn btn-primary depart-modal" id="select_button" style="width: 100px;">查询</button> &nbsp;
                    <button type="button" class="btn btn-warning depart-modal" id="reset_button" style="width: 100px;">重置</button>
                    <!--部门:<select name="dept_id" id="dept_id"></select>-->
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <button type="button" class="btn btn-success depart-modal" id="add_button" style="width: 100px;">添加</button>
                    <table id="table_id_example" class="display">
                        <thead>
                        <tr>
                            <th>操作</th>
                            <th>品类ID</th>
                            <th>品类名称</th>
                            <th>品类组名称</th>
                            <th>排序</th>
                            <th><?=TITLE_STATUS?></th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        修改品类
                    </h4>
                </div>
                <div class="modal-body">
                    <?php $form = ActiveForm::begin([
                        'id'     => 'user_form',
                        'action' => ['/goods-category/update-tag']
                    ]); ?>
                    <!--<form action="/setting/add-depart" method="post" id="depart_form">-->
                    <div class="box-body">
                        <div class="form-group">
                            <label for="role_group_id">品类组</label>

                            <select id="tag_group_id" name="tag_group_id" class="form-control" style="width: 50%;">
                                <option value="0">请选择</option>
                                <?php foreach($list as $value){?>
                                    <option value="<?= $value['id']?>"><?= $value['tag_group_name']?></option>
                                <?php }?>
                            </select>
                        </div>

                        <div class="form-group">
                            <label for="mobile">品类名称</label>
                            <input type="text" style="width: 50%;" class="form-control" name="tag_name" id="tag_name_other" placeholder="品类名称">
                        </div>

                        <div class="form-group">
                            <label for="mobile">品类别名</label>
                            <input type="text" style="width: 50%;" class="form-control" name="tag_alias" id="tag_alias_other" placeholder="品类别名">
                        </div>

                        <div class="form-group">
                            <label for="mobile">排序</label>
                            <input type="text" style="width: 50%;" class="form-control" name="sort" id="sort" placeholder="排序">
                        </div>

                        <div class="form-group">
                            <label for="exampleInputEmail1">状态</label>
                            <select id="use_flg" name="use_flg" class="form-control" style="width: 50%;">
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                        <input type="hidden" style="width: 50%;" name="id" class="form-control" id="id">
                    </div>
                    <!-- /.box-body -->

                    <?php ActiveForm::end(); ?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <a type="button" class="btn btn-primary ajax_post_depart">
                        提交
                    </a>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

    <div class="modal fade" id="role-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        添加品类
                    </h4>
                </div>
                <div class="modal-body">
                    <form action="/goods-category/add-tag" method="post" id="role_form">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="role_group_id">品类组</label>

                                <select id="tag_group_id_other" name="tag_group_id" class="form-control" style="width: 50%;">
                                    <option value="0">请选择</option>
                                    <?php foreach($list_group as $value){?>
                                        <option value="<?= $value['id']?>"><?= $value['tag_group_name']?></option>
                                    <?php }?>
                                </select>
                            </div>

                            <div class="form-group">
                                <label for="mobile">品类名称</label>
                                <input type="text" style="width: 50%;" class="form-control" name="tag_name" id="add_tag_name" placeholder="品类名称">
                            </div>

                            <div class="form-group">
                                <label for="mobile">品类别名</label>
                                <input type="text" style="width: 50%;" class="form-control" name="tag_alias" id="add_tag_alias" placeholder="品类别名">
                            </div>

                            <div class="form-group">
                                <label for="mobile">排序</label>
                                <input type="text" style="width: 50%;" class="form-control" name="sort" placeholder="排序">
                            </div>

                            <div class="form-group">
                                <label for="exampleInputEmail1">状态</label>
                                <select name="use_flg" class="form-control" style="width: 50%;">
                                    <option value="1">启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <a type="button" class="btn btn-primary ajax_post_role">
                        提交
                    </a>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<!-- 固定js -->
<script type="text/javascript" src="../static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="../static/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../static/plugins/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="../static/jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="../static/jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="../static/plugins/treeTable/jquery.treetable.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="../static/app/global.js?version=<?=Yii::$app->params['version']?>"></script>
<script type="text/javascript" src="../static/app/goods-category/goods-tag.js?version=<?=Yii::$app->params['version']?>"></script>
